package cn.wolfcode.trip.base.service.impl;


import cn.wolfcode.trip.base.domain.CommunityComment;
import cn.wolfcode.trip.base.mapper.CommunityCommentMapper;
import cn.wolfcode.trip.base.service.ICommunityCommentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Date;
import java.util.List;


@Service
public class CommunityCommentServiceImpl implements ICommunityCommentService {

    @Autowired
    private CommunityCommentMapper commentMapper;

    @Override
    public void saveComment(CommunityComment comment) {
        //设置评论时间
        Date date = new Date();
        comment.setCommentTime(date);
        //保存操作
        if(comment.getId()==null){
            commentMapper.insert(comment);
        }
    }

}
